import QtQuick 2.4
import QtQuick.Controls 2.12

Page {
    width: 400
    height: 400
    property alias buttonColor: buttonColor
    property alias buttonShow: buttonShow

    header: Label {
        text: qsTr("QML and C++ Exchange. Method 3")
        font.pixelSize: Qt.application.font.pixelSize * 2
        padding: 10
    }

    Button {
        id: buttonColor
        x: 59
        y: 171
        text: "Color"
    }

    Button {
        id: buttonShow
        x: 244
        y: 171
        text: "Show"
    }
    TextArea {
        id: textArea
        width: parent.width
        height: 134
        text: "//Method 3: Load XML in cpp,\nQQmlComponent component(&engine);\ncomponent.loadUrl(QUrl(QString(\"qrc:/Window.qml\")));\nQObject * qmlWindow = component.create();\nqmlWindow->setParent((engine.rootObjects().first()));\nengine.rootContext()->setContextProperty(\"qmlWindow\",qmlWindow);"
        placeholderText: qsTr("Text Area")
    }

    Button {
        id: buttonSetProperty
        x: 157
        y: 269
        text: "Set Property"
    }
}
